#ifndef CLIENT_H
#define CLIENT_H

#include <QDialog>
#include <QAbstractSocket>
#include <QTimer>
class QTcpSocket;

namespace Ui {
class Client;
}

class Client : public QDialog
{
    Q_OBJECT
public:
     QTimer *timer;
     QTimer *timer1;
public:
    explicit Client(QWidget *parent = 0);
    ~Client();
    unsigned int CRCCheck(unsigned char* pp, unsigned int crclen);
private:
    Ui::Client *ui;
    QTcpSocket *tcpSocket;
    QString message;
    // 用来存放数据的大小信息
    quint16 blockSize;

    bool bconnect;

private slots:
    void newConnect();
    void readMessage();
    void displayError(QAbstractSocket::SocketError);


    void on_connectButton_clicked();
    void on_pushButton_clicked();
    void onTimeout();
    void onTimeout1();
};

#endif // CLIENT_H
